#ifndef NETWORKSERVER_H
#define NETWORKSERVER_H

#include <QTcpServer>
#include <QThread>
#include <QSslSocket>
#include <QStringList>
#include <QNetworkInterface>
#include "databaseinterface.h"
#include "connection.h"

class NetworkServer : public QTcpServer
{
    Q_OBJECT
public:
    NetworkServer(QObject *parent = 0, DatabaseInterface *db = 0);
    void start();

signals:
    void listeningAt(QHostAddress *ipAddress, quint16 port);
    void error(QAbstractSocket::SocketError socketError);

protected:
    void incomingConnection(int socketDescriptor);

private:
    QSslSocket *socket;
};

#endif // NETWORKSERVER_H
